package com.xiaodu.acer.phoneplay.data;

import com.xiaodu.acer.phoneplay.bean.SearchResult;
import com.xiaodu.acer.phoneplay.data.http.ApiService;
import com.xiaodu.acer.phoneplay.presenter.contract.SearchContract;

import java.util.List;

import io.reactivex.Observable;
import library.base.BaseBean;

/**
 * @author 小杜
 *         邮箱:m15701207383@163.com
 * @version V1.0
 * @Description: ${TODO}(用一句话描述该文件做什么)
 * @date 2018/1/12 11:41
 */

public class SearchModel implements SearchContract.Model {

    private ApiService mApiService;

    public SearchModel(ApiService apiService) {
        this.mApiService = apiService;
    }

    @Override
    public Observable<BaseBean<List<String>>> getSuggestion(String keyword) {
        return mApiService.searchSuggest(keyword);
    }

    @Override
    public Observable<BaseBean<SearchResult>> search(String keyword) {
        return mApiService.search(keyword);
    }
}
